package pack0622;

import java.util.Scanner;

public class c {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        System.out.println("请输入一串字符");
        String s = scan.nextLine();
        int kongge = 0;
        int zifu = 0;
        int shuzi = 0;
        int zimu = 0;
        for (int i=0;i<s.length();i++){
            if (s.charAt(i)==32) {
                kongge++;
            }else if (s.charAt(i)>=33 && s.charAt(i)<=47){
                zifu++;
            }else if (s.charAt(i)>=48 && s.charAt(i)<=57){
                shuzi++;
            }else if (s.charAt(i)>=65 && s.charAt(i)<=122){
                zimu++;
            }
        }
        System.out.println();
        System.out.println("空格数"+kongge);
        System.out.println("字符数"+zifu);
        System.out.println("数字"+shuzi);
        System.out.println("字母"+zimu);

    }
}
